//
//  CompanyMainWorkmateCell.m
//  MyProject
//
//  Created by 石小强 on 2018/5/3.
//  Copyright © 2018年 yanjiaming. All rights reserved.
//

#import "CompanyMainWorkmateCell.h"

@implementation CompanyMainWorkmateCell

- (void)setModel:(WorkmateModel *)model {
    _model = model;
    
    [self.iconIV sd_setImageWithURL:ImageURLWithKey(model.headImg) placeholderImage:PlaceholderImage];
    if (model.hasAssurePassService) {
        self.helpIV.hidden = NO;
    } else {
        self.helpIV.hidden = YES;
    }
    self.nameL.text = model.nickName;
    self.positionL.text = model.positionName;
    
    NSDateFormatter *ft = [[NSDateFormatter alloc] init];
    [ft setDateFormat:@"YYYY"];
    NSDate *dateNow = [NSDate date];
    NSString *currentTimeStr = [ft stringFromDate:dateNow];
    NSInteger time = [currentTimeStr integerValue] - [model.entryTime integerValue];
    self.yearNumL.text = [NSString stringWithFormat:@"在职%zd年|帮助过%@人", time, model.helpedCount];
}

@end
